#!/usr/bin/env bash

source scripts/_var.sh
source scripts/_fn.sh

DEPLOY_TARGET=/data/cli/$PROC
echo "linking..."
mkdir -p "$DEPLOY_TARGET/repo"

while read -r BIN
do
  trace_on
    cp "$REPO_DIR/$PROC.$BIN.$HASH.bin" "$DEPLOY_TARGET/repo/"
    ln -sf "./repo/${BIN#cli/}.$HASH.bin" "$DEPLOY_TARGET/${BIN#cli/}.bin"
  trace_off
done < <(list_cli)
